<template>
    <div class="index">
        <h4>请求次数：{{times}}</h4>
        <h5>{{msg}}</h5>
        <a href="/hello">go to home hello</a>
    </div>
</template>

<script>
    import axios from '@/libs/axios'
    export default {
        name: 'index',
        data () {
            return {
                times: 0,
                msg: 'this is home index'
            }
        },
        methods: {
            sendQuery () {
                this.$data.times++;
                axios.post('/web/query').then( res => {
                    console.log( res.data);
                }).catch( error => {
                    console.error( error.message);
                });
            }
        },
        mounted () {
//            setInterval( this.sendQuery, 1000);
        }
    }
</script>